//
//  SEGMerchantProductDisplayModel.m
//  SEGCommunityBussinessDemo
//
//  Created by Clavis on 2019/5/14.
//  Copyright © 2019 Clavis. All rights reserved.
//

#import "SEGMerchantProductDisplayModel.h"

@implementation SEGMerchantProductDisplayModel

+ (instancetype)modelWithType:(SEGMerchantProductDisplayModelType)type firstText:(NSString *)firstText secondText:(NSString *)secondText {
    return [self modelWithType:type firstText:firstText secondText:secondText image:nil useTintColor:NO];
}

+ (instancetype)modelWithType:(SEGMerchantProductDisplayModelType)type firstText:(NSString *)firstText secondText:(NSString *)secondText image:(NSString *)image useTintColor:(BOOL)useTintColor {
    SEGMerchantProductDisplayModel *model = [[SEGMerchantProductDisplayModel alloc] init];
    model.firstText = firstText;
    model.secondText = secondText;
    model.type = type;
    model.image = image;
    model.useTintColor = useTintColor;
    return model;
}

- (NSString *)mapIdentifier {
    NSDictionary *cellIdentifierMap = @{@(SEGMerchantProductDisplayModelTypeDetail) : kMerchantCellDetail,
                                        @(SEGMerchantProductDisplayModelTypePhone) : kMerchantCellPhone,
                                        @(SEGMerchantProductDisplayModelTypeLocation) : kMerchantCellLocation,
                                        @(SEGMerchantProductDisplayModelTypeTitle) : kMerchantCellTitle,
                                        @(SEGMerchantProductDisplayModelTypeNormalText) : kMerchantCellNormalText,
                                        @(SEGMerchantProductDisplayModelTypeProduct) : kMerchantCellProduct};
    return cellIdentifierMap[@(self.type)];
}

@end
